//============================================================================
// Name        : Labyrinthe.cpp
// Author      : mpoignet
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include "Model/Game.h"
#include "Model/Grid.h"
#include "constantes.h"
#include "Model/TileFactory.h"
#include "Model/Enums.h"
#include "Model/Tile.h"
using namespace std;
using namespace Model;

void printTileInfo(Tile* t){
	cout<<"freeTile can go"<<endl;
	if(t->canGoUp())cout<< "up  ";
	if(t->canGoDown())cout<< "down  ";
	if(t->canGoRight())cout<< "right  ";
	if(t->canGoLeft())cout<< "left  ";
	cout<<endl;
}

int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!

	TileFactory* tileFactory=new TileFactory();
	MobileTile* tile=static_cast<MobileTile*>(tileFactory->createTile(MOBILE,bentTile));

	//Tile*** &matrixPointer;
	//matrixPointer=&matrix;
	Grid* grid=new Grid();

	Game* game= new Game(*grid, tile);

	/*
	printTileInfo(game->getFreeTile());
	game->setFreeTileOrientation(quarter);
	cout<< "orientation=right"<<endl;
	printTileInfo(game->getFreeTile());

	game->setFreeTileOrientation(half);
	cout<< "orientation=down"<<endl;
	printTileInfo(game->getFreeTile());

	game->setFreeTileOrientation(threeQuarter);
	cout<< "orientation=left"<<endl;
	printTileInfo(game->getFreeTile());

	game->setFreeTileOrientation(midday);
	cout<< "orientation=up"<<endl;
	printTileInfo(game->getFreeTile());
	*/
	cout<<"push"<<endl;
	game->pushTile(4);
	printTileInfo(game->getFreeTile());

	cout<<"push"<<endl;
	game->pushTile(4);
	printTileInfo(game->getFreeTile());

	cout<<"push"<<endl;
	game->pushTile(-4);
	printTileInfo(game->getFreeTile());

	cout<<"push"<<endl;
	game->pushTile(-4);
	printTileInfo(game->getFreeTile());


	return 0;
}
